import 'package:flutter/material.dart';

class Widget_AlertDialog_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("AlertDialog"),
        ),
        body: RaisedButton(
          onPressed: () {
            showDialog(
                context: context,
                builder: (BuildContext context) {
                  return AlertDialog(
                    title: Text("这是标题"),
                    titlePadding: EdgeInsets.only(bottom: 30.0, left: 10.0),
                    content: SingleChildScrollView(
                      child: ListBody(
                        children: <Widget>[
                          Text("这是第一行"),
                          Text("这是第二行"),
                          Text("这是第三行"),
                        ],
                      ),
                    ),
                    contentPadding: EdgeInsets.only(left: 40.0),
                    actions: <Widget>[
                      FlatButton(
                          onPressed: () {},
                          child: Text("取消")
                      ),
                      RaisedButton(
                        onPressed: () {},
                        child: Text(
                          "确定",
                          style: TextStyle(color: Colors.white),
                        ),
                      ),

                    ],
                  );
                }
            );
          },
          child: Text("点击显示AlertDialog"),
        ),
      ),
    );
  }

}

/**
 * 提示对话框，显示提示内容和操作按钮
 * const AlertDialog({
    Key key,
    this.title,//标题
    this.titlePadding,//标题间距
    this.content,//要显示的内容项
    this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),//内容间距
    this.actions,//底部按钮
    this.semanticLabel,//
    this.shape,//
    })
 */
